#ifndef STX_ALGORITHM_COPY_BACKWARD_HPP_
#define STX_ALGORITHM_COPY_BACKWARD_HPP_

#include <stx/algorithm/common.hpp>

namespace stx {

template <class InputIterator, class OutputIterator>
inline OutputIterator
copy_backward(InputIterator first, InputIterator last, OutputIterator result)
{
    while (first != last) {
        *--result = *--last;
    }
    return result;
}

} // namespace stx

#endif // STX_ALGORITHM_COPY_BACKWARD_HPP_
